#!/usr/bin/perl
#
# Copyright (C) 2006, Washington University in Saint Louis
# By Chien-Liang Fok.
#
# Washington University states that this script is free software;
# you can redistribute it and/or modify it under the terms of
# the current version of the GNU Lesser General Public License
# as published by the Free Software Foundation.
#
# This script is distributed in the hope that it will be useful, but
# THERE ARE NO WARRANTIES, WHETHER ORAL OR WRITTEN, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
# MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE.
#
# YOU UNDERSTAND THAT THIS SCRIPT IS PROVIDED "AS IS" FOR WHICH NO
# WARRANTIES AS TO CAPABILITIES OR ACCURACY ARE MADE. THERE ARE NO
# WARRANTIES AND NO REPRESENTATION THAT AGILLA IS FREE OF
# INFRINGEMENT OF THIRD PARTY PATENT, COPYRIGHT, OR OTHER
# PROPRIETARY RIGHTS.  THERE ARE NO WARRANTIES THAT SOFTWARE IS
# FREE FROM "BUGS", "VIRUSES", "TROJAN HORSES", "TRAP DOORS", "WORMS",
# OR OTHER HARMFUL CODE.
#
# YOU ASSUME THE ENTIRE RISK AS TO THE PERFORMANCE OF SOFTWARE AND/OR
# ASSOCIATED MATERIALS, AND TO THE PERFORMANCE AND VALIDITY OF
# INFORMATION GENERATED USING SOFTWARE. By using Agilla you agree to
# indemnify, defend, and hold harmless WU, its employees, officers and
# agents from any and all claims, costs, or liabilities, including
# attorneys fees and court costs at both the trial and appellate levels
# for any loss, damage, or injury caused by your actions or actions of
# your officers, servants, agents or third parties acting on behalf or
# under authorization from you, as a result of using Agilla.
#
# See the GNU Lesser General Public License for more details, which can
# be found here: http://www.gnu.org/copyleft/lesser.html
#

#
# This script adds WU's base java directory to the CLASSPATH
# It should be called by /opt/profile.d/washu.sh
#

$wupath = $ENV{"WUBASE"} . "/tools/java";

$sys = `uname`;
if ($sys =~ /^CYGWIN/) {
    $wupath = `cygpath -w $wupath`; 
    chop $wupath; 
}

$oldpath = $ENV{"CLASSPATH"};

if ($oldpath) {
    if ($sys =~ /^CYGWIN/) {
	print "$wupath;$oldpath\n";
    } 
    else {
	print "$wupath:$oldpath\n";
    }
}
else {
    print "$wupath\n";
}

